#define  _CRT_SECURE_NO_WARNINGS 1

#include "Stack.h"
#include "Queue.h"

void TestStack()
{
	Stack St;
	StackInit(&St);

	StackPush(&St, 1);
	StackPush(&St, 2);
	StackPush(&St, 3);
	StackPush(&St, 4);
	StackPush(&St, 5);
	StackPush(&St, 6);
	StackPush(&St, 7);

	printf("StackSize: %d\n", StackSize(&St));
	printf("StackTop: %d\n", StackTop(&St));

	while (!StackEmpty(&St))
	{
		printf("%d ", StackTop(&St));
		StackPop(&St);
	}
	printf("\n");

	printf("StackSize: %d\n", StackSize(&St));

	StackDestory(&St);
}

void TestQueue()
{
	Queue Qu;
	QueueInit(&Qu);

	QueuePush(&Qu, 'A');
	QueuePush(&Qu, 'B');
	QueuePush(&Qu, 'C');
	QueuePush(&Qu, 'D');
	QueuePush(&Qu, 'E');
	QueuePush(&Qu, 'F');
	QueuePush(&Qu, 'G');

	printf("QueueFront: %c\n", QueueFront(&Qu));
	printf("QueueBack: %c\n", QueueBack(&Qu));
	printf("QueueSize: %d\n", QueueSize(&Qu));

	while (!QueueEmpty(&Qu))
	{
		printf("%c ", QueueFront(&Qu));
		QueuePop(&Qu);
	}
	printf("\n");

	printf("QueueSize: %d\n", QueueSize(&Qu));

	QueueDestory(&Qu);
}

int main()
{
	printf("Stack: \n");
	TestStack();
	printf("\nQueue: \n");
	TestQueue();

	return 0;
}